<?php
App::uses('AppModel', 'Model');
/**
 * StatutsReponse Model
 *
 * @property reponse $reponse
 * @property nouveau_statut $nouveau_statut
 */
class StatutsReponse extends AppModel {

	// retourne l'id du statut vide
	public function idStatutVide() {
		$statut = $this->find('first', array('conditions' => array('libelle_statut_reponse' => '')));
		return $statut['StatutsReponse']['id_statut_reponse'];
	}
/**
 * Primary key field
 *
 * @var string
 */
	public $primaryKey = 'id_statut_reponse';
/**
 * Display field
 *
 * @var string
 */
	public $displayField = 'libelle_statut_reponse';
/**
 * Validation rules
 *
 * @var array
 */
	public $validate = array(
		'id_statut_reponse' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'priorite_statut_reponse' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * hasMany associations
 *
 * @var array
 */
	public $hasMany = array(
		'reponse' => array(
			'className' => 'reponse',
			'foreignKey' => 'id_statut_reponse',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
		'nouveau_statut' => array(
			'className' => 'nouveau_statut',
			'foreignKey' => 'id_statut_reponse',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);

}
